<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>创建班级</title>
<link rel="stylesheet" href="../static/layui/css/layui.css">
<style>    
  .layui-body{ padding: 10px}
</style>
</head>
<body>
    </br>
	<h2>创建班级</h2></br>
	<!-- 按钮区 -->
	<div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
	  <button class="layui-btn">创建班级</button>
	  <button class="layui-btn">班级管理</button>
	  <button data-method="notice" class="layui-btn">导入学生</button>
	</div></br>
	
	<!-- 主体内容区 lay-verify="required"必填项  -->
	<form class="layui-form" action="class?m=add" method="post">
	  <!-- 班级名 -->
	  <div class="layui-form-item">
	    <label class="layui-form-label">班级</label>
	    <div class="layui-input-block">
	      <input type="text" name="classname" required  lay-verify="required" placeholder="请输入班级名称" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <!-- 创建日期 -->
	  <div class="layui-form-item">
	    <div class="layui-inline">
	      <label class="layui-form-label">创班时间</label>
	      <div class="layui-input-inline">
	        <input type="text" name="classdate" class="layui-input" id="test1" placeholder="选择日期">
	      </div>
	    </div>
	  </div>
	  
	  <!-- 描述 -->
	  <div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">描述</label>
	    <div class="layui-input-block">
	      <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
	    </div>
	  </div>
	  
	  <!-- 状态 -->
	  <div class="layui-form-item">
	    <label class="layui-form-label">状态</label>
	    <div class="layui-input-block">
	      <select name="state" lay-verify="required">
	        <option value=""></option>
	        <option value="0">关闭</option>
	        <option value="1">打开</option>
	      </select>
        </div>
      </div>
	  
	  <!-- 提交 -->
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button type="submit" class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
	      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
	  </div>
</form>
 
</body>
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../static/layui/layui.js"></script>
<script>
//创建时间
layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  //常规用法
  laydate.render({
    elem: '#test1'
    ,type: 'datetime'
  });
});


//提交监听
layui.use('form', function(){
	  var form = layui.form;
	  
	  //监听提交
	  form.on('submit(formDemo)', function(){
	    layer.msg('注册成功，点击最后一页可查看');
	    return true;
	  });
});

//按钮切换
$(function(){
    $("button:eq(0)").click(function(){
    	window.location.href='create_user.jsp'
    });

    $("button:eq(1)").click(function(){
    	window.location.href='http://localhost:8080/OnlineExam1/admin/class_manage.jsp'
    }); 
});
</script>
</html>